package com.algorithm.base.sort;

import org.junit.Before;
import org.junit.Test;

import java.util.Arrays;

public class TestSort {
    int a[];

    @Before
    public void initData() {
        a = new int[10];
        for (int i = 0; i < 10; i++) {
            a[i] = (int) (Math.random() * 100);
        }
        System.out.println("Before Sort:" + Arrays.toString(a));
    }

    @Test
    public void testInsertSort() {
        InsertSort.sortArray(a);
        System.out.println("Insert Sort:" + Arrays.toString(a));
    }

    @Test
    public void testSelectSort() {
        SelectSort.sortArray(a);
        System.out.println("Select Sort:" + Arrays.toString(a));
    }

    @Test
    public void testBubbleSort() {
        BubbleSort.sortArray(a);
        System.out.println("Bubble Sort:" + Arrays.toString(a));
    }

    @Test
    public void testQuickSort() {
        QuickSort.sortArray(a);
        System.out.println("Quick Sort:" + Arrays.toString(a));
    }
}
